package cn.edu.sgu.www.mhxysy.dto.server;

import cn.edu.sgu.www.mhxysy.consts.CustomMessages;
import cn.edu.sgu.www.mhxysy.dto.DataTransferObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Data
@ApiModel
public class ServerDTO implements DataTransferObject {

	@ApiModelProperty(value = "ID")
	private Integer id;

	/**
	 * 服务器名
	 */
	@NotBlank(message = "服务器名" + CustomMessages.NOT_NULL)
	@ApiModelProperty(value = "服务器名", required = true)
	private String name;

	/**
	 * 大区ID
	 */
	@NotNull(message = "大区" + CustomMessages.ID_NOT_NULL)
	@ApiModelProperty(value = "大区ID", required = true)
	private Integer areaId;

	/**
	 * 开服时间
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
	@NotNull(message = "开服时间" + CustomMessages.NOT_NULL)
	@ApiModelProperty(value = "开服时间", required = true)
	private LocalDateTime openTime;
}